import 'package:bloctest/utils/base/BasePresenter.dart';
import 'package:flutter/material.dart';

abstract class LifeCyclePage extends StatefulWidget {
  const LifeCyclePage({super.key});

  @override
  LifeCyclePageState createState();
}

abstract class LifeCyclePageState<P extends LifeCyclePage> extends State<P> {
  @override
  Widget build(BuildContext context) {
    return const Placeholder();
  }

  BasePresenter? _presenter;

  BasePresenter get presenter {
    _presenter ??= createPresenter();
    return _presenter!;
  }

  BasePresenter createPresenter();

  Map<String, dynamic> get getLoadDataParams => const <String, dynamic>{};


  @override
  void initState() {
    // TODO: implement initState
    presenter.loadData(getLoadDataParams);

    super.initState();
  }

  void notify(){
    setState(() {

    });
  }

}
